<template>
  <div>
    <div  style="height: 50px">

      <form>
        <div>
          <el-button type="primary"  style="float:right"  @click="back()"  plain>返回</el-button>
        </div>
      </form>
      <h3>教师相关信息：</h3>
      <span>教师姓名：</span>
      <el-input
          placeholder="请输入内容"
          v-model="teaName"
          :disabled="true">
      </el-input>
      <span>教师邮箱：</span>
      <el-input
          placeholder="请输入内容"
          v-model="teaEmail"
          :disabled="true">
      </el-input>
      <span>教师电话：</span>
      <el-input
          placeholder="请输入内容"
          v-model="teaPhone"
          :disabled="true">
      </el-input>


    </div>
  </div>
</template>

<script>
import axios from 'axios'
import StudentCoursesMain from "@/views/studentport/studentmodule/Course/StudentCoursesMain";
export default {
  name: "ViewTea",
  data(){
    return{
      account: sessionStorage.getItem("sno"),
      sNo: '',
      courseName:this.$route.params.courseName,
      pageSize: 5,
      total: 10,
      teaName:'',
      teaEmail:'',
      teaPhone:'',
      formForSearch: {
        publishDate: '',
        noticeTitle: ''
      },
      tableData: {
        name: '',
        email: '',
        phone:''
      },
    }
  },
  created(){
    this.sNo =sessionStorage.getItem('sno')
    var that = this
    that.courseName=encodeURI(this.courseName)
    axios.get('http://localhost:8080/jas/sport/tea/selectTeaInfo/'+that.courseName).then(function (resp) {
      console.log(resp.data[0].teacher)
      that.teaName = resp.data[0].teacher.name
      that.teaEmail = resp.data[0].teacher.email
      that.teaPhone = resp.data[0].teacher.phone
      console.log(resp.data[0].teacher.name)
      console.log(resp.data[0].teacher.email)
      console.log(resp.data[0].teacher.phone)

      that.total = resp.data.total;
    })
  },

  methods: {
    back(){
      // this.$router.push('/StudentCourseMain')
          this.$router.go(-1)
      // this.$router.push({name:'/StudentMainPage/StudentCoursesMain'})
    }


  }



}
</script>

<style lang="scss" scoped>

</style>




















<!--<template>-->
<!--  <div>-->
<!--&lt;!&ndash;    <hr>&ndash;&gt;-->
<!--    <div>-->
<!--      <el-table-->
<!--          :data="tableData"-->
<!--          @selection-change="handleSelectionChange"-->
<!--          style="width: 100%">-->
<!--        <el-table-column-->
<!--            fixed-->
<!--            label="课程号"-->
<!--            prpo ="courseId"-->
<!--            type="courseId"-->
<!--            width="80">-->
<!--        </el-table-column>-->
<!--        <el-table-column-->
<!--            prop="name"-->
<!--            label="课程名"-->
<!--            width="200">-->
<!--        </el-table-column>-->
<!--        <el-table-column-->
<!--            prop="period"-->
<!--            label="课时"-->
<!--            show-overflow-tooltip-->
<!--            width="200">-->
<!--        </el-table-column>-->
<!--        <el-table-column-->
<!--            prop="credit"-->
<!--            label="学分"-->
<!--            width="200">-->
<!--        </el-table-column>-->
<!--        <el-table-column-->
<!--            prop="beginDate"-->
<!--            label="课程开始日期"-->
<!--            width="200">-->
<!--        </el-table-column>-->
<!--        <el-table-column-->
<!--            prop="endDate"-->
<!--            label="课程结束日期"-->
<!--            width="200">-->
<!--        </el-table-column>-->
<!--        <el-table-column-->
<!--            fixed="right"-->
<!--            label="查看详情"-->
<!--            width="200">-->
<!--          <template slot-scope="scope">-->
<!--            <el-button @click="viewById(scope.row)" type="text" size="small">查看</el-button>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--      </el-table>-->

<!--      <div style="float: right;margin-top: 10px">-->
<!--        <el-pagination-->
<!--            background-->
<!--            layout="prev, pager, next"-->
<!--            :page-size="pageSize"-->
<!--            :total="total"-->
<!--            @current-change="mypage">-->
<!--        </el-pagination>-->
<!--      </div>-->
<!--    </div>-->
<!--  </div>-->
<!--</template>-->

<!--<script>-->
<!--import axios from 'axios'-->
<!--export default {-->
<!--  name: "StudentCoursesMain",-->
<!--  data(){-->
<!--    return{-->
<!--      account: sessionStorage.getItem("stuAccount"),-->
<!--      comId: '',-->
<!--      pageSize: 5,-->
<!--      total: 10,-->
<!--      formForSearch: {-->
<!--        publishDate: '',-->
<!--        noticeTitle: ''-->
<!--      },-->
<!--      // props:{-->
<!--      //   courseId:String,-->
<!--      //   name:String,-->
<!--      //   period:Number,-->
<!--      //   callback: Function,-->
<!--      //-->
<!--      //-->
<!--      // }-->
<!--      // ,-->
<!--      tableData: [{-->
<!--        courseId:this.tableData.courseId,-->
<!--        name:this.tableData.name,-->
<!--        period:this.tableData.period,-->
<!--        beginDate:this.tableData.beginDate,-->
<!--        endDate:this.tableData.endDate,-->
<!--        credit:this.tableData.credit,-->
<!--      }]-->
<!--    }-->
<!--  },-->
<!--  created(){-->
<!--    this.sNo =sessionStorage.getItem('stuAccount')-->
<!--    var that = this-->
<!--    axios.get('http://localhost:8080/jas/sport/student/getCourseBySno/'+this.sNo).then(function (resp) {-->
<!--      // that.tableData = resp.data.courses.name-->
<!--      that.tableData.courseId = resp.data.courses.courseId;-->
<!--      that.tableData.name = resp.data.courses.name;-->
<!--      that.tableData.period = resp.data.courses.period;-->
<!--      that.tableData.beginDate = resp.data.courses.beginDate;-->
<!--      that.tableData.endDate = resp.data.courses.endDate;-->
<!--      that.tableData.credit = resp.data.courses.credit;-->
<!--    })-->
<!--  },-->
<!--  mounted(){-->
<!--    var _this = this-->
<!--    axios.get('http://localhost:8080/jas/sport/student/getCourseBySno/'+this.sNo).then(function (resp) {-->
<!--      console.log(resp.data)-->
<!--      _this.tableData = resp.data.courses-->
<!--    })-->
<!--  },-->
<!--  methods: {-->
<!--    handleSelectionChange(val) {-->
<!--      this.multipleSelection = val;-->
<!--      // console.log(val)-->
<!--    },-->
<!--    //table中的-->
<!--    mypage (currentpage) {-->
<!--      const _this = this-->
<!--      axios.get('http://localhost:8080/jas/mport/notice/getNoticeWithoutId/'+_this.currentPage +'/' +_this.pageSize).then(function (resp) {-->
<!--        _this.tableData = resp.data-->
<!--      })-->
<!--    },-->
<!--    viewById(row){-->
<!--      this.$router.push({name:'ViewNoticeDetail',params:{noticeId:row.id}})-->
<!--    },-->
<!--    search() {-->
<!--      if (this.formForSearch.publishDate!='' || this.formForSearch.noticeTitle!=''){-->
<!--        var _this = this-->
<!--        var form = new FormData()-->

<!--        form.append('account',this.account)-->
<!--        // form.append('publishDate',this.formForSearch.publishDate)-->
<!--        form.append('noticeTitle',this.formForSearch.noticeTitle)-->
<!--        axios.post('http://localhost:8080/jas/mport/notice/getNoticesForSearch',form).then(function (resp) {-->
<!--          const noticeList = resp.data-->
<!--          if (noticeList.length > 0){-->
<!--            _this.$router.push({name:'ViewNotice',params:{notices:noticeList}})-->
<!--          } else {-->
<!--            alert("没有符合条件的查询")-->
<!--          }-->

<!--        })-->
<!--      } else {-->
<!--        alert('请输入查询条件')-->
<!--      }-->

<!--    }-->
<!--  }-->
<!--}-->
<!--</script>-->

<!--<style lang="scss" scoped>-->

<!--</style>-->
















